package mysql

import "gorm.io/gorm"

type Doctor struct {
	gorm.Model
	Mobile   string `gorm:"type:varchar(20);not null"`
	Password string `gorm:"type:char(32);not null"`
}

func (d *Doctor) DoctorLoginAdd(db *gorm.DB, mobile string) error {
	return db.Debug().Where("mobile=?", mobile).FirstOrCreate(d).Error
}

func (d *Doctor) DoctorFindById(db *gorm.DB, id int64) error {
	return db.Debug().Where("id=?", id).First(d).Error
}
